package com.xpgk.mvc.ddc.fineRegistration;

import java.util.Map;

import com.jfinal.aop.Before;
import com.jfinal.plugin.activerecord.tx.Tx;
import com.xpgk.dto.RenderBean;
import com.xpgk.mvc.base.BaseController;
import com.xpgk.mvc.user.User;


public class FineRegistrationController extends  BaseController{
	
	private FineRegistrationService fineRegistrationService = new FineRegistrationService();
	public  void   index()
	{
		User user = getCUser();
		setAttr("user", user);
		render("fineregistration.html");
	}
	
	/**
	 * 根据编号,手机号,姓名查出信息
	 * 
	 */
	public void getVInfo() {
		String SFZMHM = getPara("sfzmhm");
		String LSH = getPara("lsh");
		String HPHM = getPara("hphm");
		
		// 获取当前登录机构id
		String orgid = getCUserOrganIds();
		Map<String, Object> mm = fineRegistrationService.getVehInfo(SFZMHM, LSH, HPHM);
		renderJson(mm);
	}
	
	/**
	 * 保存罚款登记信息
	 * */
	@Before(Tx.class)
	public  void saveInfo()
	{
		FineRegistration  fineRegistration=getModel(FineRegistration.class,"fineRegistration");
		RenderBean result=fineRegistrationService.saveInfo(fineRegistration);
		renderJson(result.getMap());
	}

}
